"""work URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
from django.contrib import admin
from myapp.views import *
from myapp.forms import *
import os
from rest_framework import routers

from myapp.views import*
from django.views.static import serve
from drf_openapi.views import SchemaView
from work.openapi import MySchemaView

router=routers.SimpleRouter()
router.register("course",CourseViewSet,base_name='course')
urlpatterns=router.urls

urlpatterns += [

    url(r'^accounts/',include('accounts.urls')),
    url(r'^store/', include('store.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^index$',index),
    url(r'^api-doc/(?P<version>[0-9])/$',SchemaView.as_view(),name='api_schema'),
    url(r'^my_add$',my_add,{'num1':7,'num2':8,'path':os.path.join('templates','ico1s960x639.jpg')}),
    # url(r'api-doc/(?P<version>[0-9]/$',SchemaView.as_view(),name="api-schema"),
    url(r'^course_views_class/id=(?P<pk>[0-9])$', CourseDetailView.as_view()),
    url(r'^course_list_class',CourseListView.as_view()),

    url(r'^MyDetailView_class$', MyDetailView.as_view()),
    url(r'^MyListView_class$',MyListView.as_view()),

    # url(r'^add/',add),
    # url(r'^delete/',delete),
    # url(r'^update/',update),

    url(r'^user_view_class_create$', Create.as_view()),
    url(r'^user_view_class_delete/id=(?P<pk>[0-9])$', Delete.as_view()),
    url(r'^user_view_class_update/id=(?P<pk>[0-9])$', Update.as_view()),

    url(r'^upload$',  UploadView.as_view()),

    url(r'^admin_ckeditor/', include('ckeditor_uploader.urls')),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": settings.MEDIA_ROOT}),
    url(r'^img$',  uploadImg),

]
